<!-- BEGIN PAGE HEADER-->
<?php $this->load->view('partials/breadcrumb.tpl') ?>
<style>
    th,td{
        text-align: center;
    }
    .o-img{
        width: 50px !important;
        height: auto !important;
        border-radius: 50%;
    }
    .o-name{
        margin-left: 5px;
    }
</style>
<script type="text/javascript">
    function defConfirm() {
        if (!confirm("确认车辆已归还吗？")) {
            return false;
        }
        return true;
    }

    $(document).ready(function () {
        $("#reset").click(function () {
            $("select").val('');
            $("input[type='text']").val('');
        });
    });
</script>
<div class="row">
    <div class="col-xs-12">
        <!-- Begin: life time stats -->
        <div class="portlet">
            <?= form_open('', Array('class' => 'form-inline', 'role' => 'form')) ?>
            <?= search_form_input('out_trade_no', filterValue('out_trade_no'), '预支付订单号', 'class="form-control input-small"'); ?>
            <?= search_form_dropdown('user_id', array('' => '选择用户...') + $allUser, filterValue('user_id'), '用户', 'class="form-control input-xs select2me"'); ?>
            <?= search_form_dropdown('status', array('' => '选择支付状态...') + [ 0 => '未支付', 1 => '已支付'], filterValue('status'), '支付状态', 'class="form-control input-xs"'); ?>
            <div style="clear:both;height:14px;"></div>
            <?= search_form_input('order_number_perpage', filterValue('order_number_perpage'), '每页显示条数', 'class="form-control input-small"'); ?>
            <div class="input-group input-large date-picker input-daterange" data-date="" data-date-format="yyyy-mm-dd">
                <input type="text" class="form-control" name="order_time_begin"
                       value="<?= filterValue('order_time_begin') ?>" placeholder="订单起始时间" autoComplete="off">
                <span class="input-group-addon">to </span>
                <input type="text" class="form-control" name="order_time_end"
                       value="<?= filterValue('order_time_end') ?>" placeholder="订单结束时间" autoComplete="off">
            </div>
            <button type="button" class="btn default" id="reset">重置条件</button>
            <button type="submit" class="btn green about_search">搜索 <i class="fa fa-search"></i></button>
            <?= form_close() ?>
            <div class="portlet-body">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="table-scrollable">
                            <table class="table table-hover table-bordered table-striped">
                                <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>类型</th>
                                    <th>预支付单号</th>
                                    <th>用户</th>
                                    <th>描述</th>
                                    <th>订单金额</th>
                                    <th>支付状态</th>
                                    <th>创建时间</th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php foreach ($list as $v) { ?>
                                    <tr>
                                        <td><?= $v->id ?></td>
                                        <td><?= $v->oid?'租车订单（ID: '.$v->oid.'）':'保证金缴纳（ID: '.$v->pid.'）' ?></td>
                                        <td><?= $v->out_trade_no ?></td>
                                        <td>
                                            <img class="o-img img-rounded" src="<?= $v->avatar ?>" alt="<?= $v->nick_name ?>">
                                            <span class="o-name"><?= $v->nick_name ?></span>
                                        </td>
                                        <td><?= $v->body ?></td>
                                        <td>￥<?= $v->total_fee ?></td>
                                        <td><?= $v->status?'<label class="label label-success">已支付</label>':'<label class="label label-warning">未支付</label>' ?></td>
                                        <td><?= date('Y-m-d H:i:s', $v->create_time) ?></td>
                                    </tr>
                                <?php } ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-12 text-right">
                        <?= $pagination ?>
                    </div>
                </div>
            </div>
        </div>
        <!-- End: life time stats -->
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $('.img-rounded').zoomify();
    });
</script>
